<?php
/*----------------------------------------------------------------------------------------------
Kit Applicatif PHP
Noyau générique d'applications PHP / generic kernel for PHP applications
noyau 0.4 / PHP 4
http://code.fredbird.org/kap

gestion des groupes, stockage sql


file version 2005-01-13 10:22:14
----------------------------------------------------------------------------------------------*/

class kap_groupManager extends kap_core_component {
/*----------------------------------------------------------------------------------------------
                                                                           parametres par defaut
----------------------------------------------------------------------------------------------*/
	var $default_parameters=array();
/*----------------------------------------------------------------------------------------------
                                                                           constructeur eventuel
----------------------------------------------------------------------------------------------*/
	/*function kap_(& $controller) {
		// appel du constructeur parent
		$const=get_parent_class($this);
		parent::$const($controller);
		// suite
	}*/
/*----------------------------------------------------------------------------------------------
                                                                              methodes publiques
a lier dans components/controller.kap-core.php et api.kap-core.php
----------------------------------------------------------------------------------------------*/
	// renvoie les identifiants de groupe d'un utilisateur
	function getUserGroupIds($userId) {
		$sql="SELECT g.id AS id"
		." FROM kap_groups AS g LEFT JOIN kap_users_groups AS u_g ON g.id=u_g.group_id"
		." WHERE u_g.user_id=".kapSqlSecureValue($userId);// echo $sql;
		if (!$results=kapSqlResult($sql,'id')) return false;
		return array_keys($results);
	}
/*----------------------------------------------------------------------------------------------
                                                                                méthodes privées
----------------------------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------*/
}
?>
